package com.company;

import java.util.Scanner;

public class Main {

    public String isWin;

    public static void main(String[] args) {
        Main main = new Main();
        System.out.println("按0开始游戏");
        NGuessNumber nGuessNumber = new NGuessNumber();
        Scanner input = new Scanner(System.in);
        int x = input.nextInt();
        while (x == 0) {
            main.isWin = String.valueOf(nGuessNumber.compareGuessAnswer());
            if (main.isWin.equals("true")) {
                System.out.println("获胜！");
            } else if (main.isWin.equals("false")) {
                System.out.println("失败！");
            }
            System.out.println("是否结束游戏，结束请按1，继续，请按0");
            int y = input.nextInt();
            if (y == 1) {
                break;
            }
        }
    }
}




